Skip to content

Adding support for untyped conversion-checking#64

Merged
ppedrot merged 43 commits intocoq-8.20from
untyped-algo
Jan 28, 2025
Merged

Adding support for untyped conversion-checking#64
ppedrot merged 43 commits intocoq-8.20from
untyped-algo

Conversation

@MevenBertrand
Copy link
Member

This PR does quite a lot, but the base goal was to support the formalisation of an untyped conversion algorithm, basically that of Coq (with term-directed η for functions and pairs).

On the way of doing that, I tried to completely segregate the logical relation and its consequences from the "syntactic" consequences of these properties (eg SR as a consequence of injectivity of type constructors) and the "algorithmic" bit. So there is quite a large reorganisation, hopefully making the whole development more modular and structured. As a nice consequence, the algorithmic bit and logrel bits can now be compiled independently, as they are only put together in the very last file.

This is still somewhat a work in progress, I want to clean it up in the coming weeks. But it should be mostly stable by now.

Base automatically changed from onlytermrel to coq-8.20 January 21, 2025 12:09
MevenBertrand and others added 29 commits January 21, 2025 12:10
removing the comparison between the types and endpoints for the equality eliminator (they are obtained by invariants instead) + general quality of life improvement
probably broken due to the changed def
admitted lemma for strengthening – for now
missing neutral cases + unproven injectivities in the universe
that escape at level zero is a terrible hack :(
this commit and the previous one don't make sense, but they are here to help git track things around
leaving deprecated direct usages of completeness
@MevenBertrand
Copy link
Member Author

Now that #63 has been merged, we can get to this one. I believe the reorganisation bit is rather uncontroversial, more modularity is always nice. The extra decidability bits, I'd say they don't hurt too much, one can always remove them in a branch or something, as PMP already did for the quoting extension for instance.

The main contentious bit is then maybe the dependency on MetaCoq? I wanted to do a bit of meta-programming, to showcase how "regular" the bidirectional invariants are. However, this adds a nasty dependency, and has a few weird consequences (including the worst: shadowing of tactics). I can work to remove it if this is preferred.

@kyoDralliam @ppedrot what do you say?

@ppedrot
Copy link
Contributor

ppedrot commented Jan 21, 2025

I'd prefer to have a dev that is as self-contained as possible, especially when metacoq is such a humongous dep.

@MevenBertrand
Copy link
Member Author

Alright, I'll try to make the change. I'll probably simply remove the meta-programming for now (which is the "easy" fix), and maybe later I'll try to port my MetaCoq code to Ltac2, which brings in a less invasive dependency (although note that atm we only depend on template, so the dependency is "reasonable").

@MevenBertrand
Copy link
Member Author

Done, MetaCoq removed in 4e63950. I think this is ready for merging. There is still some need for cleanup I think, but these will come as I write the paper I think. I'd say it's best to go forward and get at least this part out of the door.

@kyoDralliam There is quite a large reorganisation, it might wreck your other branch :/ Would you be fine with a somewhat nasty rebasing? Hopefully after that the logical relation and the rest are going to be more tightly separated, so this sort of issues should pop less often.

@MevenBertrand MevenBertrand marked this pull request as ready for review January 27, 2025 15:51
@ppedrot
Copy link
Contributor

ppedrot commented Jan 27, 2025

What's todo.v?

@MevenBertrand
Copy link
Member Author

The proof I mentioned the other day that injectivity of term constructors is provable from the existence of the eliminator, that should never have left my computer. Let me get rid of that 😬

@MevenBertrand
Copy link
Member Author

MevenBertrand commented Jan 28, 2025

Lost in typeclasses shenanigans, now it goes through :)

@MevenBertrand
Copy link
Member Author

It's good that someone is mopping up my mess 😬

Copy link
Contributor

@ppedrot ppedrot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing stands out as utterly suspect.

@ppedrot ppedrot merged commit f7f1b44 into coq-8.20 Jan 28, 2025
1 check passed
@ppedrot ppedrot deleted the untyped-algo branch January 28, 2025 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants